<?php
function lilina_schedulerapi_delete($args)
{
    extract ($args);
    if(!xarSecurityCheck('OverviewLilina')) return;
    // Get datbase setup
    $month = 60 * 60 * 24 * 30;
    $timeframe = 6 * $month;
    $delete = time() - $timeframe;

    $dbconn =& xarDBGetConn();
    $xartable =& xarDBGetTables();

    $stable = $xartable['story'];
    $query = "DELETE FROM $stable
            WHERE xar_timestamp < ?";

    $bindvars = array($delete);
    $result =& $dbconn->Execute($query,$bindvars);
    if (!$result) return;

    return true;
}
?>